#include<stdio.h>
int main(){
	int number=0;
	scanf("%d",&number);
	int a;
	int b;
	int c;
	a=number/100;
	b=number%100/10;
	c=number%10;
	int next=c*100+b*10+a;
	printf("%d",next);
}
